/**
 * Author: Baoxu
 * Date:   12-7-3
 * Time:   上午8:41
 */


addLoadEvent(highlightPage);


function highlightPage(){
	var nav = document.getElementsByTagName("nav");
	var links = nav[0].getElementsByTagName("a");
	var pageURL = window.location.href;
	for(var i = 0 ; i < links.length ; i++){
		var link = links[i].getAttribute("href");
		if(pageURL.lastIndexOf(".") == -1){
			links[0].outerHTML = "<span class='here'>home</span>";
			return;
		}else if(pageURL.indexOf(link) != -1){
			var linkText = links[i].lastChild.nodeValue;
			//addClass(links[i],"here");
			links[i].outerHTML = "<span class='here'>" + linkText + "</span>";
			return;
		}
	}
}